//
//  HNSH_RewardPoolCell.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/3/3.
//

#import "HNSH_RewardPoolCell.h"

@interface HNSH_RewardPoolCell ()

/* headerIcon */
@property (nonatomic, strong) UIImageView *headerIcon;
/* nameLabel */
@property (nonatomic, strong) UILabel *nameLabel;
/* moneyLabel */
@property (nonatomic, strong) UILabel *moneyLabel;

@end

@implementation HNSH_RewardPoolCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor whiteColor];
        [self configView];
    }
    return self;
}

- (void)configView {
    [self.contentView addSubview:self.headerIcon];
    [self.contentView addSubview:self.moneyLabel];
    [self.contentView addSubview:self.nameLabel];
    
    self.headerIcon.image = [UIImage imageNamed:@"base_user_header_icon"];
    self.nameLabel.text = @"名字";
    self.moneyLabel.text = @"10.0000汇宝";
    
    [self.headerIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.height.width.mas_equalTo(33);
        make.left.mas_equalTo(20);
    }];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.height.mas_equalTo(33);
        make.left.mas_equalTo(54);
    }];
    
    [self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.height.mas_equalTo(33);
        make.right.mas_equalTo(-20);
    }];
}

#pragma mark lazy
- (UIImageView *)headerIcon {
    if (!_headerIcon) {
        _headerIcon = [[UIImageView alloc]init];
        _headerIcon.layer.cornerRadius = 10.0f;
        _headerIcon.layer.masksToBounds = YES;
    }
    return _headerIcon;
}

- (UILabel *)nameLabel {
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.textColor = [UIColor appBlackLabelColor];
        _nameLabel.font = [UIFont boldSystemFontOfSize:14];
    }
    return _nameLabel;
}

- (UILabel *)moneyLabel {
    if (!_moneyLabel) {
        _moneyLabel = [[UILabel alloc]init];
        _moneyLabel.textColor = [UIColor appGrayLabelColor];
        _moneyLabel.font = [UIFont systemFontOfSize:12];
    }
    return _moneyLabel;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
